package com.lzk.FeignClients;

import com.lzk.domain.User;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class UserFeiginClientFallbackFactory implements FallbackFactory<UserFeiginClient> {
    @Override
    public UserFeiginClient create(Throwable throwable) {
        return new UserFeiginClient() {
            @Override
            public User getById(Long id) {
                return new User(-1L,"熔断","熔断机制触发");
            }
        };
    }
}
